package com.appspot.categoryeditor.controller;

import org.slim3.controller.Controller;
import org.slim3.controller.Navigation;

import com.appspot.categoryeditor.utils.UrlUtils;
import com.appspot.categoryeditor.utils.UserUtils;

public class IndexController extends Controller {

	@Override
	protected Navigation run() throws Exception {

		if(UserUtils.checkLogin(request)){
			String userid = UserUtils.getLoginUserId();
			return redirect("users/" + userid +"/");
		}else{
			final String SAMPLE_USERID = "categoryeditor1";
			return forward(UrlUtils.createUserPageUrl(SAMPLE_USERID, "howtouse"));
		}

	}

}
